//
//  LXConnectPairVC.m
//  bgms_d
//
//  Created by Mountain on 7/3/2019.
//  Copyright © 2019 lachesis-zhu. All rights reserved.
//

#import "LXConnectPairVC.h"
#import "LXHomeViewController.h"

@interface LXConnectPairVC ()

@end

@implementation LXConnectPairVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.detailLabel.numberOfLines = 2;
    self.detailLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    [self addNotification];
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)addNotification
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volNotication:) name:NOT_CHARACTERISTIC_UUID object:nil];
}

- (void)volNotication:(NSNotification *)notification
{
    NSData *data = notification.userInfo[kAppHeadUnitData];
    Byte *MessageBt = (Byte *)[data bytes];
    NSInteger index = MessageBt[2];
    NSLog(@"000000000000:%@", data);
    if (index == 1) {
        LXHomeViewController *homeVC = [[LXHomeViewController alloc] initWithNibName:@"LXHomeViewController" bundle:nil];
        LXThemeColorNavigationController *themeNav = [[LXThemeColorNavigationController alloc] initWithRootViewController:homeVC];
        self.view.window.rootViewController = themeNav;
    }
}

@end
